package cz.spock.parser.service;

import org.springframework.stereotype.Service;

import cz.spock.core.service.BaseService;
import cz.spock.parser.entity.RewriteRule;

/**
 * business class for RewriteRule entity
 * 
 * @author miso
 *
 */
@Service
public class RuleService extends BaseService {
    
    public RewriteRule setRewrite(String rewrite, RewriteRule rr) {
        if(rr == null) return null;
        if(rewrite == null) return rr;
        rr.setRewrite(rewrite);
        return rr;
    }
    
    public RewriteRule save(RewriteRule rr) {
        if(rr == null) return null;
        rr.setId(dao.put(rr).getId());
        return rr;
    }


}
